<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://localhost" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://localhost" elementFormDefault="qualified">
  <xs:element name="report">
    <xs:annotation>
      <xs:documentation xml:lang="ro">Raportare pentru farmacii cu circuit închis</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="hospitalRegister" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation xml:lang="ro">Condica de medicamente (lista de medicamente)</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="hospRegDrug" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                  <xs:documentation xml:lang="ro">Medicament eliberat pe condica de medicamente</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:attribute name="AppID" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="pos" type="xs:integer" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Numărul de poziţie pe condica de medicamente</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="supplyCode" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Codul de consumabil (valoare din nomenclator)</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="quantity" type="xs:double" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Cantitatea consumată</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="retailPrice" type="xs:double" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Preţul cu amănuntul</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="personPID" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Codul de identificate al persoanei (CNP)</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="diseaseCode" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Codul de boală (G)</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="nhpNo" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Numărul programului naţional de sănătate.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="nhpCategory" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Categoria programului naţional de sănătate</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="patientInsuranceHouse" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Codul casei de asigurare a pacientului</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="merNo" type="xs:integer" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Numărul de înregistrare în registrul de consultaţii.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="merDate" type="xs:date" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Data înregistrării în registrul de consultaţii.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="physicianContract" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Numărul contractului medicului</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="physicianStencil" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Parafa medicului</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="physicianSpeciality" type="xs:string" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Codul specialităţii medicului</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="isInsured" type="xs:boolean" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Specfică dacă pacientul este asigurat sau nu.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="supplyType" type="xs:int" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Tipul de consumabil.</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="AppID" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="hospRegDate" type="xs:date" use="optional">
              <xs:annotation>
                <xs:documentation xml:lang="ro">Data condicii de medicamente</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="healthDepartment" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation xml:lang="ro">Codul departametului de spitalului</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="chiefPhysicianContract" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation xml:lang="ro">Numărul de contractul al medicului şef</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="chiefPhysicianStencil" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation xml:lang="ro">Parafa medicului şef</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="chiefPhysicianSpeciality" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation xml:lang="ro">Codul specialităţii mediclui şef</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="hospRegNo" type="xs:string" use="optional">
              <xs:annotation>
                <xs:documentation xml:lang="ro">Numărul foii de condică în registrul spitalului</xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="isPrescription" type="xs:boolean" use="optional">
              <xs:annotation>
                <xs:documentation xml:lang="ro">Specifică dacă medicamentul este eliberat pe bază de reţetă</xs:documentation>
              </xs:annotation>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="AppKey" type="xs:string" use="optional">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Cheia de identificare a aplicaţiei de raportare (producator de software 3rd partry)</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="AppID" type="xs:string" use="optional">
        <xs:annotation>
					<xs:documentation xml:lang="ro">Identificator unic al raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="pharmacy" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Denumirea farmaciei</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="fiscalCode" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Codul unic de identificare al farmaciei (docul fiscal)</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="contractNo" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Numărul de contract al farmaciei</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="insuranceHouse" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Codul casei de asigurări cu care are contract farmacia</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="reportingDate" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Data la care s-a efectuat raportarea</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="startFrom" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Data de la cere se incepe raportarea</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="endTo" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Datra la care se termină raportarea</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>